//导入定义验证规则的模块
const joi = require('joi')

//定义文章列表数据库的验证规则
const name = joi.string().required()
const alias = joi.string().alphanum().required()
const id = joi.number().integer().required()

//添加文章的数据验证规则对象
exports.add_cate_schema = {
    body: {
        name,
        alias
    }
}
//删除分类的验证规则对象
exports.delete_cate_schema = {
    params: {
        id
    }
}
//获取分类的验证规则对象
exports.get_cate_schema = {
    params: {
        id
    }
}
//更新分类的验证规则对象
exports.update_cate_schema = {
    body: {
        Id: id,
        name,
        alias
    }
}